package cn.itcast.mq.config;

import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


/**
 * @author Xiao
 * @version 1.0
 * @description 惰性队列
 * @date 2021/11/19
 */
@Configuration
public class LazyMessageConfig {
    /**
     * 声明普通队列
     * @return
     */
    @Bean
    public Queue normalQueue() {
        return QueueBuilder.durable("normal.queue").build();
    }

    /**
     * 声明惰性队列
     * @return
     */
    @Bean
    public Queue lazyQueue() {
        return QueueBuilder.durable("lazy.queue").lazy().build();
    }
}
